<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑可写字段</title>
<import type="css" file="css.workform" />
<import type="js" file="js.jquery" />
<script>
function func_insert()
{
	$("select[name=select2] option").each(function(){
		if( $(this).attr("selected") ){
			var val = $(this).val();
			var text = $(this).text();
			$(this).remove();
			$("select[name=select1]").append("<option value="+val+" selected >"+text);
		}
	});
}
function func_delete()
{
	$("select[name=select1] option").each(function(){
		if( $(this).attr("selected") ){
			var val = $(this).val();
			var text = $(this).text();
			$(this).remove();
			$("select[name=select2]").append("<option value="+val+" selected >"+text);
		}
	});
}
function func_select_all1()
{
	$("select[name=select1] option").each(function(){
		$(this).attr("selected",true);
	});
}
function func_select_all2()
{
	$("select[name=select2] option").each(function(){
		$(this).attr("selected",true);
	});
}

function mysubmit(){
	var proc_item = "";
	$("select[name=select1] option").each(function(){
		var val = $(this).val();
		if(val != ''){
			proc_item+=val+",";
		}
	});
	$("input[name=proc_item]").attr("value",proc_item);
}
</script>
</head>
<body class="bodycolor" topmargin="5" onload="func_init();">

<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
	<td class="Big"><img src="__PUBLIC__/images/edit.gif" WIDTH="22" HEIGHT="20" align="absmiddle"><span class="big3"> 步骤{$data_proc.proc_no} - 编辑可写字段</span><br>
	</td>
</tr>
</table>
<br>
<table width="450" border="0" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" class="small">
<tr bgcolor="#CCCCCC">
	<td align="center"><b>本步骤可写字段</b></td>
	<td align="center">&nbsp;</td>
	<td align="center" valign="top"><b>备选字段</b></td>
</tr>
<tr>
	<td valign="top" align="center" bgcolor="#CCCCCC">
	<select  name="select1" ondblclick="func_delete();" MULTIPLE style="width:200px;height:280px">
		<php>if($proc_item_select != null){</php>
		<volist name="proc_item_select" id="vo">
			<option value="{$vo}">{$vo}
		</volist>
		<php>}</php>
	</select>
	<input type="button" value=" 全 选 " onclick="func_select_all1();" class="SmallInput">
	</td>
	<td align="center" bgcolor="#999999">
		<input type="button" class="SmallInput" value=" ← " onclick="func_insert();">
		<br><br>
		<input type="button" class="SmallInput" value=" → " onclick="func_delete();">
	</td>
	<td align="center" valign="top" bgcolor="#CCCCCC">
	<select  name="select2" ondblclick="func_insert();" MULTIPLE style="width:200px;height:280px">
        <volist name="form_item" id="vo1">
        	<option value="{$vo1}">{$vo1}
        </volist>
    </select>
	<input type="button" value=" 全 选 " onclick="func_select_all2();" class="SmallInput">
	</td>
</tr>
<tr bgcolor="#CCCCCC">
<form action="__APP__/WorkFlowSys/flow_process_item_save" method="post" name="form1">
	<td align="center" valign="top" colspan="3">
	点击条目时，可以组合CTRL或SHIFT键进行多选<br>
		<input type="submit" class="BigButton" value="保 存" onclick="mysubmit();">&nbsp;&nbsp;&nbsp;&nbsp;
        <input type="button" class="BigButton" value="返 回" onclick="history.back();">
     	<input type='hidden' value="" name="GRAPH">
		<input type="hidden" name="type_id" value="{$data_proc.type_id}">
		<input type="hidden" name="proc_id" value="{$data_proc.proc_id}">
		<input type="hidden" name="proc_item" value="">
	</td>
</form>
</tr>
</table>
</body>
</html>
